package org.apache.test.api.jdk8;

import java.util.Optional;

/**
 * Created by admin on 2018/9/4.
 */
interface CardCondition {
    boolean conditionTrue(Integer card);

    default  boolean isConditionTrue(Optional<Integer> cardOp) {
        if (!cardOp.isPresent()) {
            return false;
        }
        System.out.println(cardOp.get());
        return conditionTrue(cardOp.get());
    }
}